package com.foreverwin.mes.lims.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.foreverwin.mes.core.base.FrontPage;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.foreverwin.mes.lims.model.CommandReview;
import com.foreverwin.mes.lims.mapper.CommandReviewMapper;
import com.foreverwin.mes.lims.service.CommandReviewService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * <p>
 * 复机审核 服务实现类
 * </p>
 *
 * @author Max
 * @since 2020-02-28
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class CommandReviewServiceImpl extends ServiceImpl<CommandReviewMapper, CommandReview> implements CommandReviewService {


    @Autowired
    private CommandReviewMapper commandReviewMapper;

    @Override
    public Page<CommandReview> selectPage(FrontPage<CommandReview> frontPage, CommandReview commandReview) {
        EntityWrapper<CommandReview> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(commandReview);
        return super.selectPage(frontPage.getPagePlus(), queryWrapper);
    }

    @Override
    public List<CommandReview> selectList(CommandReview commandReview) {
        EntityWrapper<CommandReview> queryWrapper = new EntityWrapper<>();
        queryWrapper.setEntity(commandReview);
        return super.selectList(queryWrapper);
    }

    /**
     * 保存复机审核结果
     */
    @Override
    public int saveReSetReviewResult( List<CommandReview> commandReviewList ) {

        return 0;
    }

    /**
     * 查询待审核的复机指令
     */
    @Override
    public List<CommandReview> selectReviewCommand(CommandReview commandReview) {
        return commandReviewMapper.selectReviewCommand(commandReview);
    }


}